import { LeftOutlined } from "@ant-design/icons";
import { FloatButton } from "antd"
import React, { useCallback } from "react"
import { useNavigate } from "react-router-dom";
import styled from "styled-components";

const BackWrap = styled.div`
    height: 65px;
`
const BackButton = () => {

    const navigate = useNavigate()
    const goBack = useCallback(() => {
        navigate(-1)
    }, [navigate])
    return <BackWrap>
        <FloatButton
            style={{ bottom: 'auto', right: 'auto', top: 15, left: 15 }}
            icon={<LeftOutlined />}
            type="primary"
            onClick={goBack}
        />
    </BackWrap>
}

export default BackButton;